package com.ruoyi.production.service.impl.greenhousefilm;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.production.domain.greenhousefilm.GreenhousefilmPurchaseApply;
import com.ruoyi.production.mapper.greenhousefilm.GreenhousefilmPurchaseApplyMapper;
import com.ruoyi.production.service.greenhousefilm.IGreenhousefilmPurchaseApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 棚膜购买申请Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class GreenhousefilmPurchaseApplyServiceImpl implements IGreenhousefilmPurchaseApplyService
{
    @Autowired
    private GreenhousefilmPurchaseApplyMapper greenhousefilmPurchaseApplyMapper;

    /**
     * 查询棚膜购买申请
     *
     * @param greenhousefilmPurchaseApplyId 棚膜购买申请ID
     * @return 棚膜购买申请
     */
    @Override
    public GreenhousefilmPurchaseApply selectGreenhousefilmPurchaseApplyById(Long greenhousefilmPurchaseApplyId)
    {
        return greenhousefilmPurchaseApplyMapper.selectGreenhousefilmPurchaseApplyById(greenhousefilmPurchaseApplyId);
    }

    /**
     * 查询棚膜购买申请列表
     *
     * @param greenhousefilmPurchaseApply 棚膜购买申请
     * @return 棚膜购买申请
     */
    @Override
    public List<GreenhousefilmPurchaseApply> selectGreenhousefilmPurchaseApplyList(GreenhousefilmPurchaseApply greenhousefilmPurchaseApply)
    {
        return greenhousefilmPurchaseApplyMapper.selectGreenhousefilmPurchaseApplyList(greenhousefilmPurchaseApply);
    }

    /**
     * 新增棚膜购买申请
     *
     * @param greenhousefilmPurchaseApply 棚膜购买申请
     * @return 结果
     */
    @Override
    public int insertGreenhousefilmPurchaseApply(GreenhousefilmPurchaseApply greenhousefilmPurchaseApply)
    {
        greenhousefilmPurchaseApply.setCreateTime(DateUtils.getNowDate());
        return greenhousefilmPurchaseApplyMapper.insertGreenhousefilmPurchaseApply(greenhousefilmPurchaseApply);
    }

    /**
     * 修改棚膜购买申请
     *
     * @param greenhousefilmPurchaseApply 棚膜购买申请
     * @return 结果
     */
    @Override
    public int updateGreenhousefilmPurchaseApply(GreenhousefilmPurchaseApply greenhousefilmPurchaseApply)
    {
        greenhousefilmPurchaseApply.setUpdateTime(DateUtils.getNowDate());
        return greenhousefilmPurchaseApplyMapper.updateGreenhousefilmPurchaseApply(greenhousefilmPurchaseApply);
    }

    /**
     * 批量删除棚膜购买申请
     *
     * @param greenhousefilmPurchaseApplyIds 需要删除的棚膜购买申请ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmPurchaseApplyByIds(Long[] greenhousefilmPurchaseApplyIds)
    {
        return greenhousefilmPurchaseApplyMapper.deleteGreenhousefilmPurchaseApplyByIds(greenhousefilmPurchaseApplyIds);
    }

    /**
     * 删除棚膜购买申请信息
     *
     * @param greenhousefilmPurchaseApplyId 棚膜购买申请ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmPurchaseApplyById(Long greenhousefilmPurchaseApplyId)
    {
        return greenhousefilmPurchaseApplyMapper.deleteGreenhousefilmPurchaseApplyById(greenhousefilmPurchaseApplyId);
    }
}
